home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / unix / volume7 / image / part01 next >
Encoding:
Internet Message Format  |  1986-11-30  |  36.8 KB

  1. Subject:  v07i064:  Image manipulation routines in C++, Part01/05
  2. Newsgroups: mod.sources
  3. Approved: mirror!rs
  4.  
  5. Submitted by: David Sher <seismo!rochester!sher>
  6. Mod.sources: Volume 7, Issue 64
  7. Archive-name: image/Part01
  8.  
  9.  
  10. [  The Makefiles had ESCAPE and \r characters in their comment lines;
  11.    I changed them to their printable representation, the two-character
  12.    sequences ^[ and ^M, respectively.  Also, the file ascii2var/uu.test.var
  13.    had some non-ASCII characters in it; I used uuencode; the resultant
  14.    file is really ascii2var/test.var.  Also, I do not have C++ nor any
  15.    images, so I have not tested this package.  --r$  ]
  16.  
  17. #!/bin/sh
  18. # This is a shell archive.  Remove anything before this line,
  19. # then unpack it by saving it in a file and typing "sh file".
  20. # If all goes well, you will see the message "No problems found."
  21. # Wrapped by mirror!rs on Mon Nov 10 13:38:43 EST 1986
  22.  
  23. # Exit status; set to 1 on "wc" errors or if would overwrite.
  24. STATUS=0
  25. # Contents:  ascii2var correlate lowerbound man scale truncate
  26. #    upperbound var2ascii varc++ vartools README copywrite
  27. #    ascii2var/main.c++ ascii2var/makefile ascii2var/uu.test.var
  28. #    correlate/main.c++ correlate/makefile lowerbound/main.c++
  29. #    lowerbound/makefile man/image.5 man/iff2var.1 man/var2iff.1
  30. #    man/ascii2var.1
  31.  
  32. for I in ascii2var correlate lowerbound man scale truncate upperbound \
  33.         var2ascii varc++ vartools ; do
  34.     if test -d $I ; then
  35.     echo Directory $I exists, changing mode just in case
  36.     else
  37.     echo mkdir - $I
  38.     mkdir $I
  39.     fi
  40.     chmod 777 $I
  41. done
  42. echo x - README
  43. if test -f README ; then
  44.     echo README exists, putting output in $$README
  45.     OUT=$$README
  46.     STATUS=1
  47. else
  48.     OUT=README
  49. fi
  50. sed 's/^X//' > $OUT <<'@//E*O*F README//'
  51. XThis directory contains a set of files that constitute a package of routines
  52. Xfor manipulating images in C++.  These routines are designed to be
  53. Xfile format independent.  The interface to your local image file
  54. Xformat will have to be written on site.  At this time there are
  55. Xinterfaces written for the Maryland U image file format (mv) and the U
  56. XBritish Columbia image file form (iff) which can be supplied at
  57. Xrequest to the author.  The routines supplied are interfaced to the
  58. Xlocally produced vision archive format (var) which is an extension of
  59. Xiff to handle a more varied type of image.  The makefiles in this
  60. Xpackage assume a program called c++ which takes a file with c++ 
  61. Xsource and terminates in .c++ and returns a file that ends in .o.
  62. XNote that some modification of the makefiles are probably necessary 
  63. Xfor your system.  This software isn't and isn't meant to be self installing.
  64. XI tolerate this because it will probably have to be modified in any
  65. Xcase to run with the local image file format.
  66. X-David Sher
  67. Xsher@rochester
  68. X{seismo,allegra}!rochester!sher
  69. X/*
  70. XCopyright (C) 1986, David Sher in the University of Rochester
  71. XPermission is granted to any individual or institution to use, copy, or
  72. Xredistribute this software so long as it is not sold for profit, provided
  73. Xthis copyright notice is retained.
  74. X*/
  75. @//E*O*F README//
  76. chmod u=rw,g=r,o=r $OUT
  77.  
  78. echo x - copywrite
  79. if test -f copywrite ; then
  80.     echo copywrite exists, putting output in $$copywrite
  81.     OUT=$$copywrite
  82.     STATUS=1
  83. else
  84.     OUT=copywrite
  85. fi
  86. sed 's/^X//' > $OUT <<'@//E*O*F copywrite//'
  87. X/*
  88. XCopyright (C) 1986, David Sher in the University of Rochester
  89. XPermission is granted to any individual or institution to use, copy, or
  90. Xredistribute this software so long as it is not sold for profit, provided
  91. Xthis copyright notice is retained.
  92. X*/
  93. @//E*O*F copywrite//
  94. chmod u=rw,g=r,o=r $OUT
  95.  
  96. echo x - ascii2var/main.c++
  97. if test -f ascii2var/main.c++ ; then
  98.     echo ascii2var/main.c++ exists, putting output in $$ascii2var/main.c++
  99.     OUT=$$ascii2var/main.c++
  100.     STATUS=1
  101. else
  102.     OUT=ascii2var/main.c++
  103. fi
  104. sed 's/^X//' > $OUT <<'@//E*O*F ascii2var/main.c++//'
  105. X/*
  106. X    This is the main routine for translating 
  107. X    ascii to floating point images
  108. X*/
  109.  
  110. X#include <stream.h>
  111. X#include <stdio.h>
  112. X#include <vartools.h++>
  113.  
  114. Xint
  115. Xmain(int argc,char *argv[])
  116. X    {
  117. X    switch ( argc )
  118. X    {
  119. X    // with 0 arguments it is a pipe
  120. X    case 1:
  121. X    ascii2var(stdin,stdout);
  122. X    break;
  123. X    // with 1 arguments it takes from named file to stdout
  124. X    case 2:
  125. X    {
  126. X    FILE *input;    // pointer to the input file
  127. X    if ( NULL == ( input = fopen(argv[1],"r") ) )
  128. X        {
  129. X        perror("ascii2var");
  130. X        return 2;
  131. X        }
  132. X    ascii2var(input,stdout);
  133. X    }
  134. X    break;
  135. X    // with 2 arguments it takes from named file to named file
  136. X    case 3:
  137. X    {
  138. X    FILE *input;    // pointer to the input file
  139. X    FILE *output;    // pointer to the output file
  140. X    if ( NULL == ( input = fopen(argv[1],"r") ) )
  141. X        {
  142. X        perror("ascii2var");
  143. X        return 2;
  144. X        }
  145. X    if ( NULL == ( output = fopen(argv[2],"w") ) )
  146. X        {
  147. X        perror("ascii2var");
  148. X        return 2;
  149. X        }
  150. X    ascii2var(input,output);
  151. X    }
  152. X    break;
  153. X    // otherwise something is wrong
  154. X    default:
  155. X    cerr << "Syntax is: ascii2var [input [output]]\n";
  156. X    return 1;
  157. X    }
  158. X    return 0;
  159. X    }
  160. X/*
  161. XCopyright (C) 1986, David Sher in the University of Rochester
  162. XPermission is granted to any individual or institution to use, copy, or
  163. Xredistribute this software so long as it is not sold for profit, provided
  164. Xthis copyright notice is retained.
  165. X*/
  166. @//E*O*F ascii2var/main.c++//
  167. chmod u=rw,g=r,o=r $OUT
  168.  
  169. echo x - ascii2var/makefile
  170. if test -f ascii2var/makefile ; then
  171.     echo ascii2var/makefile exists, putting output in $$ascii2var/makefile
  172.     OUT=$$ascii2var/makefile
  173.     STATUS=1
  174. else
  175.     OUT=ascii2var/makefile
  176. fi
  177. sed 's/^X//' > $OUT <<'@//E*O*F ascii2var/makefile//'
  178. X# this is the makefile for iff2var
  179.  
  180. X.SUFFIXES: .c++ 
  181.  
  182. X# This line constructs the program name (equal to the directory name)
  183. X# jccpwd^[!!sh^M:s/.*\///g^MIPROGRAM = ^[
  184. XPROGRAM = ascii2var
  185.  
  186. XCFLAGS = -O -I/usr/grads/include -DVAX -Ddebug 
  187.  
  188.  
  189. XC++FLAGS = +i $(CFLAGS)
  190.  
  191. XLIBS = -lvartools -lvarc++ -lvar -liff 
  192.  
  193. X# This line constructs the list of possible objects
  194. X# 2jc}ls *[A-Za-z0-9].c *.c++^[!!sh^M>}>}:g/\.c\+*$/ s//.o \\/^M
  195. XOBJS = \
  196. X    main.o 
  197.  
  198.  
  199. X.c++.o:
  200. X    c++ -c  $(C++FLAGS) $*.c++ 
  201.  
  202. X# the program is linked by this line
  203. X$(PROGRAM) : $(OBJS)
  204. X    CC -o $(PROGRAM) $(CFLAGS) $(OBJS) $(LIBS) 
  205.  
  206. X# the program is linted by this line
  207. X$(PROGRAM).lint : *.c 
  208. X    lint -hb *.c -lm > lint.out
  209. @//E*O*F ascii2var/makefile//
  210. chmod u=rw,g=r,o=r $OUT
  211.  
  212. echo x - ascii2var/uu.test.var
  213. if test -f ascii2var/uu.test.var ; then
  214.     echo ascii2var/uu.test.var exists, putting output in $$ascii2var/uu.test.var
  215.     OUT=$$ascii2var/uu.test.var
  216.     STATUS=1
  217. else
  218.     OUT=ascii2var/uu.test.var
  219. fi
  220. sed 's/^X//' > $OUT <<'@//E*O*F ascii2var/uu.test.var//'
  221. Xbegin 644 test.tar
  222. XM(3QA<F-H/@I?+DA%041%4B`@("`@("`@+3$@("`@("`@("`@.3@@("`@,3`@
  223. XM("`@-C0T("`@("`Y.2`@("`@("`@8`I&:6QE(%1Y<&4@/2!V87AD;W5B;&4*
  224. XM0GET97,@<&5R(%!I>&5L(#T@.`I.=6UB97(@0F%N9',@/2`R"C`@/2!L;W=?
  225. XM<&EX96QS(&EF9@HS,B`](&AI9VA?<&EX96QS(&EF9@H*7RY#3TU-14Y44R`@
  226. XM("`@("TQ("`@("`@("`@(#DX("`@(#$P("`@(#8T-"`@("`@,34@("`@("`@
  227. XM(&`*5&AI<R!I<R!A('1E<W0*"FQO=U]P:7AE;',@("`@("`M,2`@("`@("`@
  228. XM("`Y."`@("`Q,"`@("`V-#0@("`@(#$P-#@@("`@("!@"DEM86=E9FEL92!V
  229. XM97)S:6]N+3(Z(&YR;W=S(#T@,B!N8V]L<R`](#,@8G!P(#T@,S(@<VEG;F5D
  230. XM(#T@,"!P;W-I=&EV92`](#$*````````````````````````````````````
  231. XM````````````````````````````````````````````````````````````
  232. XM````````````````````````````````````````````````````````````
  233. XM````````````````````````````````````````````````````````````
  234. XM````````````````````````````````````````````````````````````
  235. XM````````````````````````````````````````````````````````````
  236. XM````````````````````````````````````````````````````````````
  237. XM````````````````````````````````````````````````````````````
  238. XM````````````````````````````````````````````````````````````
  239. XM````````````````````````````````````````````````````````````
  240. XM````````````````````````````````````````````````````````````
  241. XM````````````````````````````````````````````````````````````
  242. XM````````````````````````````````````````````````````````````
  243. XM````````````````````````````````````````````````````````````
  244. XM````````````````````````````````````````````````````````````
  245. XM````````````````````````````````````````````````````````````
  246. XM````````````````````````````````````````````````````````````
  247. XM````````````````````````````````````````````````````````````
  248. XM````````````````````````````````````````````````````````````
  249. XM````````````````````````````````````````````````````````````
  250. XM````````````````````````````````````````````````````````````
  251. XM`````````````````````````````````/`_`%JE0%EV8<(``#'`'W[0O0``
  252. XM`$!H:6=H7W!I>&5L<R`@("`@+3$@("`@("`@("`@.3@@("`@,3`@("`@-C0T
  253. XM("`@("`Q,#0X("`@("`@8`I);6%G969I;&4@=F5R<VEO;BTR.B!N<F]W<R`]
  254. XM(#(@;F-O;',@/2`S(&)P<"`](#,R('-I9VYE9"`](#`@<&]S:71I=F4@/2`Q
  255. XM"@``````````````````````````````````````````````````````````
  256. XM````````````````````````````````````````````````````````````
  257. XM````````````````````````````````````````````````````````````
  258. XM````````````````````````````````````````````````````````````
  259. XM````````````````````````````````````````````````````````````
  260. XM````````````````````````````````````````````````````````````
  261. XM````````````````````````````````````````````````````````````
  262. XM````````````````````````````````````````````````````````````
  263. XM````````````````````````````````````````````````````````````
  264. XM````````````````````````````````````````````````````````````
  265. XM````````````````````````````````````````````````````````````
  266. XM````````````````````````````````````````````````````````````
  267. XM````````````````````````````````````````````````````````````
  268. XM````````````````````````````````````````````````````````````
  269. XM````````````````````````````````````````````````````````````
  270. XM````````````````````````````````````````````````````````````
  271. XM````````````````````````````````````````````````````````````
  272. XM````````````````````````````````````````````````````````````
  273. XM````````````````````````````````````````````````````````````
  274. XM````````````````````````````````````````````````````````````
  275. XM````````````````````````````````````````````````````````````
  276. X>``````````#P/P!:I4!9=F'"```QP!]^T+T```!`
  277. X`
  278. Xend
  279. @//E*O*F ascii2var/uu.test.var//
  280. chmod u=rw,g=rw,o=rw $OUT
  281.  
  282. echo x - correlate/main.c++
  283. if test -f correlate/main.c++ ; then
  284.     echo correlate/main.c++ exists, putting output in $$correlate/main.c++
  285.     OUT=$$correlate/main.c++
  286.     STATUS=1
  287. else
  288.     OUT=correlate/main.c++
  289. fi
  290. sed 's/^X//' > $OUT <<'@//E*O*F correlate/main.c++//'
  291. X/*
  292. X    This is the main routine for the correlation program
  293. X    Syntax is:
  294. X    correlation template.var [input.var [output.var]]
  295. X*/
  296.  
  297. X#include <stream.h>
  298. X#include <stdio.h>
  299. X#include <double_image.h++>
  300. X#include <vartools.h++>
  301.  
  302. Xint
  303. Xmain ( int argc , char *argv[] )
  304. X    {
  305. X    switch(argc)
  306. X    {
  307. X    // if only 1 argument act as a pipe
  308. X    case 2:
  309. X    {
  310. X    FILE *template_file;
  311. X    // open the template file
  312. X    if ( NULL == (template_file = fopen(argv[1],"r")))
  313. X        {
  314. X        perror(form("Problem with opening %s mode r:",argv[1]));
  315. X        return 2;
  316. X        }
  317. X    // do the correlation
  318. X    correlate(template_file,stdin,stdout,"");
  319. X    }
  320. X    break;
  321. X    // if two arguments use the second for input file
  322. X    case 3:
  323. X    {
  324. X    FILE *template_file;
  325. X    // open the template file
  326. X    if ( NULL == (template_file = fopen(argv[1],"r")))
  327. X        {
  328. X        perror(form("Problem with opening %s mode r:",argv[1]));
  329. X        return 2;
  330. X        }
  331. X    FILE *input_file;
  332. X    // open the input file
  333. X    if ( NULL == (input_file = fopen(argv[2],"r")))
  334. X        {
  335. X        perror(form("correlate: Problem with opening %s mode r:",argv[2]));
  336. X        return 3;
  337. X        }
  338. X    // do the correlation
  339. X    correlate(template_file,input_file,stdout,"");
  340. X    }
  341. X    break;
  342. X    // if 3 arguments use the second for input and the 3rd for output
  343. X    case 4:
  344. X    {
  345. X    FILE *template_file;
  346. X    // open the template file
  347. X    if ( NULL == (template_file = fopen(argv[1],"r")))
  348. X        {
  349. X        perror(form("correlate: Problem with opening %s mode r:",argv[1]));
  350. X        return 2;
  351. X        }
  352. X    FILE *input_file;
  353. X    // open the input file
  354. X    if ( NULL == (input_file = fopen(argv[2],"r")))
  355. X        {
  356. X        perror(form("correlate: Problem with opening %s mode r:",argv[2]));
  357. X        return 3;
  358. X        }
  359. X    FILE *output_file;
  360. X    // open the output file
  361. X    if ( NULL == (output_file = fopen(argv[3],"w")))
  362. X        {
  363. X        perror(form("correlate: Problem with opening %s mode w:",argv[3]));
  364. X        return 4;
  365. X        }
  366. X    // do the correlation
  367. X    correlate(template_file,input_file,output_file,"");
  368. X    }
  369. X    break;
  370. X    // if wrong number of arguments print error message and exit
  371. X    default:
  372. X    cerr << "Syntax is: correlation template.var [input.var [output.var]]\n";
  373. X    return 1;
  374. X    break;
  375. X    }
  376. X    return 0;
  377. X    }
  378. X/*
  379. XCopyright (C) 1986, David Sher in the University of Rochester
  380. XPermission is granted to any individual or institution to use, copy, or
  381. Xredistribute this software so long as it is not sold for profit, provided
  382. Xthis copyright notice is retained.
  383. X*/
  384. @//E*O*F correlate/main.c++//
  385. chmod u=rw,g=r,o=r $OUT
  386.  
  387. echo x - correlate/makefile
  388. if test -f correlate/makefile ; then
  389.     echo correlate/makefile exists, putting output in $$correlate/makefile
  390.     OUT=$$correlate/makefile
  391.     STATUS=1
  392. else
  393.     OUT=correlate/makefile
  394. fi
  395. sed 's/^X//' > $OUT <<'@//E*O*F correlate/makefile//'
  396. X# this is the makefile for iff2var
  397.  
  398. X.SUFFIXES: .c++ 
  399.  
  400. X# This line constructs the program name (equal to the directory name)
  401. X# jccpwd^[!!sh^M:s/.*\///g^MIPROGRAM = ^[
  402. XPROGRAM = correlate
  403.  
  404. XCFLAGS = -O -I/usr/grads/include -DVAX -Ddebug 
  405.  
  406.  
  407. XC++FLAGS = +i $(CFLAGS)
  408.  
  409. XLIBS = -lvartools -lvarc++ -lvar -liff 
  410.  
  411. X# This line constructs the list of possible objects
  412. X# 2jc}ls *[A-Za-z0-9].c *.c++^[!!sh^M>}>}:g/\.c\+*$/ s//.o \\/^M
  413. XOBJS = \
  414. X    main.o 
  415.  
  416.  
  417. X.c++.o:
  418. X    c++ -c  $(C++FLAGS) $*.c++ 
  419.  
  420. X# the program is linked by this line
  421. X$(PROGRAM) : $(OBJS)
  422. X    c++ -o $(PROGRAM) $(CFLAGS) $(OBJS) $(LIBS) 
  423.  
  424. X# the program is linted by this line
  425. X$(PROGRAM).lint : *.c 
  426. X    lint -hb *.c -lm > lint.out
  427. @//E*O*F correlate/makefile//
  428. chmod u=rw,g=r,o=r $OUT
  429.  
  430. echo x - lowerbound/main.c++
  431. if test -f lowerbound/main.c++ ; then
  432.     echo lowerbound/main.c++ exists, putting output in $$lowerbound/main.c++
  433.     OUT=$$lowerbound/main.c++
  434.     STATUS=1
  435. else
  436.     OUT=lowerbound/main.c++
  437. fi
  438. sed 's/^X//' > $OUT <<'@//E*O*F lowerbound/main.c++//'
  439. X/*
  440. X    This applies an lower bound to a var file
  441. X    The syntax is:
  442. X    lowerbound bound [input.var [output.var]]
  443. X*/
  444. X#include <stream.h>
  445. X#include <stdio.h>
  446. X#include <vartools.h++>
  447.  
  448.  
  449. Xint
  450. Xmain ( int argc , char *argv[] )
  451. X    {
  452. X    switch(argc)
  453. X    {
  454. X    // with 1 argument it acts as a pipe
  455. X    case 2:
  456. X    lower_bound(atof(argv[1]),stdin,stdout,"Bounding file from stdin\n");
  457. X    break;
  458. X    // with 2 arguments it reads from specified file and writes to stdout
  459. X    case 3:
  460. X    FILE *input;
  461. X    if(NULL == (input = fopen(argv[2],"r")))
  462. X        {
  463. X        perror(form("lowerbound problem with openning %s:",argv[2]));
  464. X        return 5;
  465. X        }
  466. X    lower_bound(atof(argv[1]),input,stdout,form("bounding file %s\n",argv[2]));
  467. X    break;
  468. X    // with 3 arguments it reads from specified file and writes to 
  469. X    // specified file
  470. X    case 4:
  471. X    FILE *input;
  472. X    FILE *output;
  473. X    if(NULL == (input = fopen(argv[2],"r")))
  474. X        {
  475. X        perror(form("lowerbound problem with openning %s:",argv[2]));
  476. X        return 5;
  477. X        }
  478. X    if(NULL == (output = fopen(argv[3],"w")))
  479. X        {
  480. X        perror(form("lowerbound problem with openning %s:",argv[3]));
  481. X        return 6;
  482. X        }
  483. X    lower_bound(atof(argv[1]),input,output,form("bounding file %s to file %s\n",argv[2],argv[3]));
  484. X    break;
  485. X    // otherwise wrong number of arguments failure!
  486. X    default:
  487. X    cerr << "Syntax is: lowerbound bound [input.var [output.var]]";
  488. X    return 1;
  489. X    break;
  490. X    }
  491. X    return 0;
  492. X    }
  493. X/*
  494. XCopyright (C) 1986, David Sher in the University of Rochester
  495. XPermission is granted to any individual or institution to use, copy, or
  496. Xredistribute this software so long as it is not sold for profit, provided
  497. Xthis copyright notice is retained.
  498. X*/
  499. @//E*O*F lowerbound/main.c++//
  500. chmod u=rw,g=r,o=r $OUT
  501.  
  502. echo x - lowerbound/makefile
  503. if test -f lowerbound/makefile ; then
  504.     echo lowerbound/makefile exists, putting output in $$lowerbound/makefile
  505.     OUT=$$lowerbound/makefile
  506.     STATUS=1
  507. else
  508.     OUT=lowerbound/makefile
  509. fi
  510. sed 's/^X//' > $OUT <<'@//E*O*F lowerbound/makefile//'
  511. X# this is the makefile for iff2var
  512.  
  513. X.SUFFIXES: .c++ 
  514.  
  515. X# This line constructs the program name (equal to the directory name)
  516. X# jccpwd^[!!sh^M:s/.*\///g^MIPROGRAM = ^[
  517. XPROGRAM = lowerbound
  518.  
  519. XCFLAGS = -O -I/usr/grads/include -DVAX -Ddebug 
  520.  
  521.  
  522. XC++FLAGS = +i $(CFLAGS)
  523.  
  524. XLIBS = -lvartools -lvarc++ -lvar -liff 
  525.  
  526. X# This line constructs the list of possible objects
  527. X# 2jc}ls *[A-Za-z0-9].c *.c++^[!!sh^M>}>}:g/\.c\+*$/ s//.o \\/^M
  528. XOBJS = \
  529. X    main.o 
  530.  
  531.  
  532. X.c++.o:
  533. X    c++ -c  $(C++FLAGS) $*.c++ 
  534.  
  535. X# the program is linked by this line
  536. X$(PROGRAM) : $(OBJS)
  537. X    c++ -o $(PROGRAM) $(CFLAGS) $(OBJS) $(LIBS) 
  538.  
  539. X# the program is linted by this line
  540. X$(PROGRAM).lint : *.c 
  541. X    lint -hb *.c -lm > lint.out
  542. @//E*O*F lowerbound/makefile//
  543. chmod u=rw,g=r,o=r $OUT
  544.  
  545. echo x - man/image.5
  546. if test -f man/image.5 ; then
  547.     echo man/image.5 exists, putting output in $$man/image.5
  548.     OUT=$$man/image.5
  549.     STATUS=1
  550. else
  551.     OUT=man/image.5
  552. fi
  553. sed 's/^X//' > $OUT <<'@//E*O*F man/image.5//'
  554. X.TH IMAGE 5 8/19/86
  555. X.CM 1
  556. X.SH "NAME"
  557. Ximage \- double_image long_image
  558. X.SH "SYNOPSIS"
  559. X.nf
  560. X// for a long image
  561. X#include <long_image.h++>
  562. X// for a double image
  563. X#include <double_image.h++>
  564. X// to create your own image type
  565. X#include <image.h++>
  566. X.sp
  567. X// this is the base data structure for images:
  568. X.sp
  569. X.sp
  570. X/*
  571. X    The operations that can be applied when creating the window.
  572. X    one can read in an image or create one.
  573. X*/
  574. Xenum create_image_type { CREATE = 7 };
  575. Xenum read_image_type { READ = 4 };
  576. X.sp
  577. X.sp
  578. X/* protection for images */
  579. Xenum image_prot 
  580. X    { 
  581. X    CAN_READ = 1 , 
  582. X    CAN_WRITE = 2 , 
  583. X    CAN_READ_AND_WRITE = 3 ,
  584. X    CAN_NOT_DO_ANYTHING = 4
  585. X    };
  586. X.sp
  587. X/*
  588. X    useful for determining the status of data structures
  589. X*/
  590. Xenum status { INITIALIZED = 8 , UNINITIALIZED = 16 };
  591. X.sp
  592. X/*
  593. X    This is the abstract data type for any image
  594. X    Actually objects of this type are not useful
  595. X    it is meant to have derived types
  596. X*/
  597. Xclass image_class
  598. X    {
  599. Xpublic:
  600. X    card number_rows;        // number rows in image
  601. X    card number_cols;        // number of collumns in image
  602. X    void * header_info ;    // any further header information required by implementation
  603. X    image_prot prot;        // the protection of the image 
  604. X    card comment_length;    // the length of the comments
  605. X    char * comments ;        // comments about the image
  606. X    status image_status;    // determines when image data is initialized
  607. X.sp
  608. X    /* position in image */
  609. X    status window_status;    // determines when the window has been initialized
  610. X    card collumn;        // the collumn
  611. X    card row;            // the row
  612. X    card window_width;        // width of possible window in image
  613. X    card window_length;        // length of possible window in image
  614. X    FILE * file;        // file associated with image
  615. X.sp
  616. X    /* constructors for images */
  617. X    /* constructor when reading an image from a file */
  618. X    image_class
  619. X    ( 
  620. X    const read_image_type rit ,     // marker that the image is being read
  621. X    const FILE * image_file ,    // file for image
  622. X    const card w_width  ,    // window width
  623. X    const card w_length     // window length
  624. X    );
  625. X.sp
  626. X    /* constructor for creating a new image */
  627. X    image_class
  628. X    ( 
  629. X    const create_image_type cit,    // maker that the image is being created
  630. X    const FILE * image_file ,     // the file for the image
  631. X    const card n_rows ,         // the number of rows in the image
  632. X    const card n_cols ,         // the number of collumns in the image
  633. X    const card w_width ,         // the width of the window
  634. X    const card w_length         // the length of the window
  635. X    );
  636. X.sp
  637. X    /* destructor for images */
  638. X    ~image_class () { ; }
  639. X.sp
  640. X    /* comment manipulation */
  641. X.sp
  642. X    /* sets the comments */
  643. X    void set_comments( char * string , const card length );
  644. X.sp
  645. X    /* adds a string to the comments */
  646. X    void add_comment( char * string , const card length );
  647. X.sp
  648. X    /* for moving around in an image */
  649. X.sp
  650. X.sp
  651. X    /*
  652. X    move in row n steps 
  653. X    returns 1 when that motion is legal 0 otherwise
  654. X    */
  655. X    virtual int move_collumn ( const int n ) ;
  656. X.sp
  657. X    /*
  658. X    move in collumn n steps
  659. X    returns 1 when that motion is legal 0 otherwise
  660. X    */
  661. X    virtual int move_row ( const int n ) ;
  662. X.sp
  663. X    /*
  664. X    move to specified row
  665. X    */
  666. X    virtual void move_to_row ( const card n ) ;
  667. X.sp
  668. X    /*
  669. X    move to specified collumn
  670. X    */
  671. X    virtual void move_to_collumn ( const card n ) ;
  672. X.sp
  673. X    /* routine to write out the image to a file */
  674. X    virtual void write ( ) ;
  675. X.sp
  676. X    /* change the protection from CAN_WRITE to CAN_READ_AND_WRITE */
  677. X    virtual void read_and_write ( );
  678. X.sp
  679. X    };
  680. X.sp
  681. X/* returns a null terminated string for comments */
  682. Xconst char * comment_string ( image_class& i );
  683. X.sp
  684. X.sp
  685. X// This is the derived type for images of doubles.
  686. X// The derived type for longs is the same with long replacing double
  687. X.sp
  688. X.sp
  689. X/*
  690. X    the definition of the class to manage image structures
  691. X*/
  692. Xclass double_image : image_class
  693. X    {
  694. X    double *image_buffer;    // buffer to hold image
  695. X    double **image_rows;    // pointers to the rows of the image
  696. X    double **window_rows;    // pointers to the rows of the window
  697. X    /* functions for function pointers */
  698. X    ...
  699. X.sp
  700. Xpublic:
  701. X    /* constructors */
  702. X    /* the constructor when the image is being read from a file */
  703. X    double_image
  704. X    ( 
  705. X    const read_image_type rit ,     // marker that the image is being read
  706. X    const FILE * image_file ,    // file for image
  707. X    const card w_width = 1 ,    // window width
  708. X    const card w_length = 1        // window length
  709. X    );
  710. X.sp
  711. X    /* the constructor when the image is built */
  712. X    double_image
  713. X    ( 
  714. X    const create_image_type cit ,    // marker that the image is being created
  715. X    const card n_rows ,         // the number of rows in the image
  716. X    const card n_cols ,         // the number of collumns in the image
  717. X    const FILE * image_file ,    // file for image
  718. X    const card w_width = 1 ,    // window width
  719. X    const card w_length = 1     // window length
  720. X    );
  721. X.sp
  722. X    /* destructor (who would want to destroy an image?) */
  723. X    ~double_image ( ) { ; }
  724. X.sp
  725. X    /* access routines for parts of data structure */
  726. X    const card n_rows() { return number_rows ; }
  727. X    const card n_cols() { return number_cols ; }
  728. X    const image_prot the_prot() { return prot; }
  729. X    const card c_length() { return comment_length ; }
  730. X    const char *the_comments() { return comments ; }
  731. X    const card the_collumn() { return collumn ; }
  732. X    const card the_row() { return row ; }
  733. X    const card the_width() { return window_width ; }
  734. X    const card the_length() { return window_length ; }
  735. X    const FILE * the_file() { return file ; }
  736. X    const status image_init() { return image_status ; }
  737. X    const status window_init() { return window_status ; }
  738. X.sp
  739. X    /* access a pointer to a particular row */
  740. X    const double * get_row( card row );
  741. X.sp
  742. X    /* sets the comments */
  743. X    void set_comments( char * string , const card length )
  744. X    {
  745. X    this->image_class::set_comments ( string , length );
  746. X    }
  747. X.sp
  748. X    /* adds a string to the comments */
  749. X    void add_comment( char * string , const card length )
  750. X    {
  751. X    this->image_class::add_comment ( string , length );
  752. X    }
  753. X.sp
  754. X.sp
  755. X    /* real versions of virtual functions */
  756. X    /* routine to write out the image to a file */
  757. X    void write ( ) ;
  758. X.sp
  759. X    /*
  760. X    move in row n steps 
  761. X    returns 1 when that motion is legal 0 otherwise
  762. X    */
  763. X    int move_collumn ( const int n ) ;
  764. X.sp
  765. X    /*
  766. X    move in collumn n steps
  767. X    returns 1 when that motion is legal 0 otherwise
  768. X    */
  769. X    int move_row ( const int n ) ;
  770. X.sp
  771. X    /*
  772. X    move to specified row
  773. X    */
  774. X    void move_to_row ( const card n ) ;
  775. X.sp
  776. X    /*
  777. X    move to specified collumn
  778. X    */
  779. X    void move_to_collumn ( const card n ) ;
  780. X.sp
  781. X    
  782. X    /*
  783. X    the function to get the specified element of a window
  784. X    it is a function pointer so that unitialized windows
  785. X    or protected images don't get read from
  786. X    this accesses the function pointer
  787. X    */
  788. X    double get_w_e ( const card i , const card j )
  789. X    { return (( double (*) (...) )(* get_w_e_pointer)) ( this , i , j ); }
  790. X.sp
  791. X    /*
  792. X    the fast function without checking for initialization
  793. X    of a function pointer for getting elements of a window
  794. X    Also no bounds checking!
  795. X    ( Not recommended!)
  796. X    */
  797. X    double fast_g_w_e ( const card i , const card j )
  798. X    { return window_rows[i][j]; }
  799. X    
  800. X    /*
  801. X    the function to write to the specified element of a window.
  802. X    it is a function pointer so that unitialized windows
  803. X    or protected images don't get read from
  804. X    this accesses the function pointer
  805. X    */
  806. X    void write_w_e ( const card i , const card j , const double value )
  807. X    { ((void (*) (...) )(* write_w_e_pointer)) ( this , i , j , value ); }
  808. X.sp
  809. X    /*
  810. X    the fast function without checking for initialization
  811. X    of a function pointer for writing elements to a window
  812. X    Also no bounds checking!
  813. X    ( Not recommended!)
  814. X    */
  815. X    void fast_w_w_e ( const card i , const card j , const double value )
  816. X    { window_rows[i][j] = value; }
  817. X.sp
  818. X    /* 
  819. X    the function call on the image gets the upper left hand 
  820. X    of the image window and returns a reference so it can be
  821. X    used as a lvalue or rvalue
  822. X    optimized so does not check that the window is initialized
  823. X    if the window is not initialized then odd things may happen
  824. X    */
  825. X    double& operator() ()
  826. X    { return **window_rows; }
  827. X    
  828. X    /* 
  829. X    move to next legal position in image
  830. X    returns 1 when there is a next legal position 0 otherwise
  831. X    if the window is not initialized then it initializes it.
  832. X    with the window in the position 0,0 (if possible)
  833. X    */
  834. X    int (* next) (...); /* this will point to member functions! */
  835. X.sp
  836. X    /* 
  837. X    move to previous legal position in image
  838. X    returns 1 when there is a previous legal position 0 otherwise
  839. X    if the window is not initialized then it initializes it.
  840. X    with the window in the farthest position (if possible)
  841. X    */
  842. X    int (* prev) (...); /* this will point to member functions! */
  843. X.sp
  844. X    /*
  845. X    Access for next and previous elements of images
  846. X    */
  847. X    int operator++ ( ) 
  848. X    { return (* next) ( this /* because points to member*/ ); }
  849. X    int operator-- ( ) 
  850. X    { return (* prev) ( this /* because points to member*/ ); }
  851. X.sp
  852. X    /*
  853. X    Change the size of a window
  854. X    causes the window to become uninitialized
  855. X    */
  856. X    void resize_window ( card width , card length );
  857. X.sp
  858. X    /*
  859. X    Causes the window to cover the entire image.
  860. X    Allows one to access any part of the image with window operations
  861. X    */
  862. X    void window_entire_image ( );
  863. X.sp
  864. X    };
  865. X.sp
  866. X.fi
  867. XCompile with -lvarc++ -lvar -liff 
  868. X.SH "DESCRIPTION"
  869. XThis is a description of a C++ class to access images.
  870. XIt handles the concept of a 2d array of longs or doubles
  871. Xwith a window of a specified size.
  872. XThe routines are designed
  873. Xto check in so far as possible for illegal values given to them
  874. Xsuch as points outside the window to the window routines.
  875. XThe current implementation is designed to work with the var
  876. Ximage package (
  877. X.B "var(3)"
  878. X).
  879. X.IP "CONSTRUCTORS"
  880. XThere are two constructors for double or long images.  The first
  881. Xreads in the image and constructs the correct image data structure
  882. Xfor it.  It should be called as:
  883. X.nf
  884. X{double,long}_image input(READ,file_pointer)
  885. Xor
  886. X{double,long}_image input(READ,file_pointer,window_width,window_length)
  887. X.fi
  888. XThe last two arguments are optional and control the size of the
  889. Xwindow.  If they are omitted then the window is 1 by 1.  
  890. X.br
  891. XThe other constructor is used to create an image for output which is
  892. Xnot read in from a file.  It should be called as:
  893. X.nf
  894. X{double,long}_image output
  895. X    (
  896. X    CREATE,
  897. X    number_rows,
  898. X    number_collumns,
  899. X    file_pointer
  900. X    )
  901. Xor
  902. X{double,long}_image output
  903. X    (
  904. X    CREATE,
  905. X    number_rows,
  906. X    number_collumns,
  907. X    file_pointer,
  908. X    window_width,
  909. X    window_length
  910. X    )
  911. X.fi
  912. XAs before the last two arguments are optional and when left out are
  913. Xinitialized to 1.  
  914. X.PP
  915. XThe destructor for images is currently null.
  916. X.IP "Access Routines"
  917. XThese routines retrieve interesting private parts of the data
  918. Xstructure that can be useful.  This allows parts of an image to be
  919. Xread only.  This also one to pass parts of the data structure to C
  920. Xroutines.  The first few retrieve information about the image as a
  921. Xwhole.
  922. X.br
  923. X.B "n_rows:"
  924. X retrieves the number of rows in the image.
  925. X.br
  926. X.B "n_cols:"
  927. X retrieves the number of collumns in the image.
  928. X.br
  929. X.B "the_prot:"
  930. X retrieves the protection status of the image.  This way one can tell
  931. Xwhether the image is read or write protected.
  932. X.br
  933. X.B "c_length:"
  934. X returns the number of chars in the comments
  935. X.br
  936. X.B "the_comments:"
  937. X returns a 
  938. X.I "not necessarily"
  939. Xnull terminated string containing the comments.
  940. X.br
  941. X.B "the_file:"
  942. X returns the file pointer which is the file for the image.
  943. X.br
  944. X.B "image_init:"
  945. X returns whether the image has been initialized.
  946. X.br
  947. X.br
  948. XThe next few access functions control the window to the image.
  949. X.br
  950. X.B "window_init:"
  951. X returns whether the image window has been initialized.
  952. X.br
  953. X.B "the_collumn:"
  954. X the collumn of the upper left hand corner of the window.
  955. X.br
  956. X.B "the_row:"
  957. X the row of the upper left hand corner of the window.
  958. X.br
  959. X.B "the_width:"
  960. X the width of the window.
  961. X.br
  962. X.B "the_length:"
  963. X the length of the window.
  964. X.br
  965. X.br
  966. XAnother access function mostly for C routines is 
  967. X.B get_row
  968. Xthat retrieves a pointer to a specified row in an image.
  969. X.br
  970. X.br
  971. XA command that is not part of the access routines but functions in
  972. Xmuch the same way is 
  973. X.B "comment_string"
  974. Xthat takes an image and returns a null terminated string for the
  975. Xcomment.
  976. X.IP "Comment Management"
  977. XThere are two routines that are used to construct comments for an
  978. Ximage.  
  979. X.B "set_comments"
  980. Xsets the comments to a specified string of a specified length.  
  981. X.B "add_comments"
  982. Xadds to the already existing comments a specified string of a
  983. Xspecified length.
  984. X.IP "Output"
  985. X.B "write"
  986. Xwrites the image out to its specified file.
  987. X.IP "Moving the Window"
  988. X.B "move_collumn" 
  989. Xand
  990. X.B "move_row"
  991. Xincrementally move the window to a specified number of rows or
  992. Xcollumns.  They both return a boolean to indicate whether the
  993. Xmove is possible.  
  994. X.B "move_to_row"
  995. Xand
  996. X.B "move_to_collumn"
  997. Xare used to move the window on the image to a specified position in
  998. Xthe image.  They will print an error message and dump core if an
  999. Xillegal position is specified.  
  1000. X.IP "Iterating through an Image"
  1001. XFor iterating through an entire image there are two function
  1002. X.I "pointers"
  1003. X.B "*next" and 
  1004. X.B "*prev."
  1005. XWhen 
  1006. X.B "*next" 
  1007. Xis called on an initialized image it initializes the window and 
  1008. Xsends it to the upper left hand corner of the image.  Successive calls
  1009. Xmove the window along the row until it doesn't fit any more and then
  1010. Xto the beginning of the next collumn.  
  1011. X.B "*prev" 
  1012. Xstarts on the bottom right of the the image and moves backwards.  
  1013. X.B "++"
  1014. Xis overloaded to be 
  1015. X.B "*next" 
  1016. Xon images and
  1017. X.B "--"
  1018. Xis overloaded to be
  1019. X.B "*prev"
  1020. Xon images.
  1021. XBoth functions return true when they are legal and false when
  1022. Xthey fall off the image.  If they fall off the image they do nothing.
  1023. XOne can iterate through an image using these this way:
  1024. X.nf
  1025. Xwhile(++image)
  1026. Xor
  1027. Xwhile(++input,++output)
  1028. X.fi
  1029. XWhen the second technique is used one must be careful to make sure
  1030. Xthat the size of output is (input.n_rows() - input.the_length() + 1 ,
  1031. Xinput.n_cols() - input.the_width() + 1).
  1032. X.IP "Accessing Window Elements"
  1033. XThere are several functions for reading or writing to elements of a
  1034. Xwindow.  For reading
  1035. X.B "get_w_e"
  1036. Xreturns a window element.  A version of this exists without any
  1037. Xchecking that the numbers given make sense.  It is called 
  1038. X.B "fast_get_w_e."
  1039. XUse of this code is not recomended.
  1040. XSimilarly 
  1041. X.B "write_w_e"
  1042. Xand
  1043. X.B "fast_write_w_e"
  1044. Xwrite a value to a particular point in a window.  Once again I do not
  1045. Xrecomend using 
  1046. X.B "fast_write_w_e."
  1047. XIf you only want to access the (0,0) element of a window (especially
  1048. Xuseful if your window is default size).  You can use the overloaded
  1049. Xfunction call operator
  1050. X.B "()"
  1051. Xto access or write to this element.
  1052. Xas an example:
  1053. X.nf
  1054. Xoutput() = 7;
  1055. Xwrites 7 to the upper left hand corner of the window on the image
  1056. Xoutput.
  1057. Xcout << input();
  1058. Xwrites the upper left hand corner of the window to the stdout.
  1059. X.fi
  1060. X.IP "Changing the Size of the Window"
  1061. XTwo member functions are supplied to retrieve the size of an existing
  1062. Xwindow:
  1063. X.B "resize_window"
  1064. Xand
  1065. X.B "window_entire_image."
  1066. X.B "resize_window" 
  1067. Xchanges the size of a window to a specified size.
  1068. X.b "window_entire_image" 
  1069. Xmakes the window size the same as the image size and makes the entire
  1070. Ximage inside the window.  This allows one to access any part of the
  1071. Ximage array as a point in the window.
  1072. X.SH "FILES"
  1073. X/usr/local/include/image.h++
  1074. X/usr/local/include/double_image.h++
  1075. X/usr/local/include/long_image.h++
  1076. X.SH "SEE ALSO"
  1077. Xvar(3)
  1078. X.SH "DIAGNOSTICS"
  1079. XUsually crashes out with an error message and a core dump
  1080. Xif something suspicious is tried.
  1081. X.SH "BUGS"
  1082. XEither my code has absolutely and completely no bugs or I am
  1083. Xa bare faced liar.
  1084. X.SH HISTORY
  1085. X.TP
  1086. X19-Aug-86  David Sher (sher) at University of Rochester
  1087. XCreated.
  1088. @//E*O*F man/image.5//
  1089. chmod u=rw,g=r,o=r $OUT
  1090.  
  1091. echo x - man/iff2var.1
  1092. if test -f man/iff2var.1 ; then
  1093.     echo man/iff2var.1 exists, putting output in $$man/iff2var.1
  1094.     OUT=$$man/iff2var.1
  1095.     STATUS=1
  1096. else
  1097.     OUT=man/iff2var.1
  1098. fi
  1099. sed 's/^X//' > $OUT <<'@//E*O*F man/iff2var.1//'
  1100. X.TH IFF2VAR 1 8/21/86
  1101. X.CM 1
  1102. X.SH "NAME"
  1103. Xiff2var \- Program to convert iff files to var format.
  1104. X.SH "SYNOPSIS"
  1105. Xiff2var [input.iff [output.var]]
  1106. X.SH "DESCRIPTION"
  1107. XThis is the routine to convert iff files to var files.
  1108. XIt also
  1109. Xdemonstrates how the var(3) routines can be called from C.
  1110. XIf given no arguments it acts as a pipe.
  1111. XIf you give it
  1112. Xone argument it takes it as the input file and sends the output
  1113. Xto stdout.
  1114. XWith two arguments it uses the first for input and
  1115. Xthe second for output.
  1116. X.SH "SEE ALSO"
  1117. Xvar(3) var(5) iff2var(3)
  1118. X.SH "DIAGNOSTICS"
  1119. XSome errors cause core dumps others not.
  1120. X.SH "BUGS"
  1121. XNo doubt.
  1122. X.SH HISTORY
  1123. X.TP
  1124. X21-Aug-86  David Sher (sher) at University of Rochester
  1125. XCreated.
  1126. @//E*O*F man/iff2var.1//
  1127. chmod u=rw,g=r,o=r $OUT
  1128.  
  1129. echo x - man/var2iff.1
  1130. if test -f man/var2iff.1 ; then
  1131.     echo man/var2iff.1 exists, putting output in $$man/var2iff.1
  1132.     OUT=$$man/var2iff.1
  1133.     STATUS=1
  1134. else
  1135.     OUT=man/var2iff.1
  1136. fi
  1137. sed 's/^X//' > $OUT <<'@//E*O*F man/var2iff.1//'
  1138. X.TH VAR2IFF 1 8/21/86
  1139. X.CM 1
  1140. X.SH "NAME"
  1141. Xvar2iff \- a conversion program from var format to iff
  1142. X.SH "SYNOPSIS"
  1143. Xvar2iff [input.var [output.iff]]
  1144. X.SH "DESCRIPTION"
  1145. XThis takes files in the var(5) image format and generates files
  1146. Xin the iff(5) image format.
  1147. XIf no arguments this is a pipe,
  1148. Xwith one argument uses it to find input with two arguments 
  1149. Xuses them for input and output.
  1150. X.SH "SEE ALSO"
  1151. Xvar(3) var(5) iff(5) var2iff(3) iff2var(1)
  1152. X.SH "DIAGNOSTICS"
  1153. XDumps core at times when given spurious input.
  1154. XShould always print error messages though!
  1155. X.SH "BUGS"
  1156. XNone so far.
  1157. X.SH HISTORY
  1158. X.TP
  1159. X21-Aug-86  David Sher (sher) at University of Rochester
  1160. XCreated.
  1161. @//E*O*F man/var2iff.1//
  1162. chmod u=rw,g=r,o=r $OUT
  1163.  
  1164. echo x - man/ascii2var.1
  1165. if test -f man/ascii2var.1 ; then
  1166.     echo man/ascii2var.1 exists, putting output in $$man/ascii2var.1
  1167.     OUT=$$man/ascii2var.1
  1168.     STATUS=1
  1169. else
  1170.     OUT=man/ascii2var.1
  1171. fi
  1172. sed 's/^X//' > $OUT <<'@//E*O*F man/ascii2var.1//'
  1173. X.TH ASCII2VAR 1 8/25/86
  1174. X.CM 1
  1175. X.SH "NAME"
  1176. Xascii2var \- A program to translate an ascii file to a floating point image
  1177. X.SH "SYNOPSIS"
  1178. Xascii2var [input.ascii [output.var]]
  1179. X.SH "DESCRIPTION"
  1180. XThis is the program that takes a file in ascii format and returns a
  1181. Xvar(5) file.
  1182. XThe ascii format is a pair of dimensions (length followed
  1183. Xby width) and then the pixels followed by comments.
  1184. XIf no arguments
  1185. Xit is a pipe.
  1186. XOtherwise it can take an input file and send to stdout
  1187. Xor it can take both an input and an output file.
  1188. XThis program can facilitate passing floating point images
  1189. Xbetween machines with incompatible floating point formats.
  1190. X.SH "SEE ALSO"
  1191. Xvar(5) var(3) vartools(3)
  1192. Xvar2ascii(1)
  1193. X.SH "DIAGNOSTICS"
  1194. XIf something major goes wrong it prints an error message and dumps
  1195. Xcore.
  1196. X.SH "BUGS"
  1197. XHmmm...
  1198. @//E*O*F man/ascii2var.1//
  1199. chmod u=rw,g=r,o=r $OUT
  1200.  
  1201. echo Inspecting for damage in transit...
  1202. temp=/tmp/sharin$$; dtemp=/tmp/sharout$$
  1203. trap "rm -f $temp $dtemp; exit" 0 1 2 3 15
  1204. cat > $temp <<\!!!
  1205.       24     222    1311 README
  1206.        6      42     249 copywrite
  1207.       61     207    1344 main.c++
  1208.       31     102     671 makefile
  1209.       58      60    3415 uu.test.var
  1210.       93     317    2359 main.c++
  1211.       31     102     672 makefile
  1212.       60     208    1630 main.c++
  1213.       31     102     673 makefile
  1214.      534    2655   15637 image.5
  1215.       26     121     688 iff2var.1
  1216.       23     106     647 var2iff.1
  1217.       25     133     793 ascii2var.1
  1218.     1003    4377   30089 total
  1219. !!!
  1220. wc  README copywrite ascii2var/main.c++ ascii2var/makefile ascii2var/uu.test.var correlate/main.c++ correlate/makefile lowerbound/main.c++ lowerbound/makefile man/image.5 man/iff2var.1 man/var2iff.1 man/ascii2var.1 | sed 's=[^ ]*/==' | diff -b $temp - >$dtemp
  1221. if test -s $dtemp ; then
  1222.     echo "Ouch [diff of wc output]:"
  1223.     cat $dtemp
  1224.     STATUS=1
  1225. elif test $STATUS = 0 ; then
  1226.     echo "No problems found."
  1227. else
  1228.     echo "WARNING -- PROBLEMS WERE FOUND..."
  1229. fi
  1230. exit $STATUS
  1231.